home *** CD-ROM | disk | FTP | other *** search
/ Champak 43 / Vol 43.iso / games / superdog.swf / scripts / DefineSprite_1407 / frame_2 / DoAction.as
Encoding:
Text File  |  2007-06-25  |  929 b   |  47 lines

  1. stop();
  2. this.swapDepths(100 + _parent._parent.dep++);
  3. onEnterFrame = function()
  4. {
  5.    if(_parent._parent.pauses == false)
  6.    {
  7.       if(dix == false)
  8.       {
  9.          this._x -= spd;
  10.          long += spd;
  11.          this._xscale = 100;
  12.       }
  13.       else
  14.       {
  15.          this._x += spd;
  16.          long += spd;
  17.          this._xscale = -100;
  18.       }
  19.       if(long >= 400)
  20.       {
  21.          long = 0;
  22.          if(dix == false)
  23.          {
  24.             dix = true;
  25.          }
  26.          else
  27.          {
  28.             dix = false;
  29.          }
  30.       }
  31.       if(Math.abs(_parent._parent.man._x - this.getBounds(_parent._parent).xMin) <= 20 and atked == false)
  32.       {
  33.          this.gotoAndPlay("attack");
  34.       }
  35.       if(atked == true)
  36.       {
  37.          i++;
  38.          if(i >= 60)
  39.          {
  40.             i = 0;
  41.             atked = false;
  42.             this.gotoAndPlay("Θú₧");
  43.          }
  44.       }
  45.    }
  46. };
  47.